package langnstats.project.languagemodel.loglinear;

import langnstats.project.lib.WordType;
import langnstats.project.lib.clustering.WordTypeClusterer;

public class FirstToken extends LLFeature{
	
	private static final long serialVersionUID = 42L; 
	
	private int history=0;
	private String head=null;
	
	public String getFeature(WordType token){
		String feature="";
		
		if(history==0){
			head=token.getName();
		}
		
		feature=head;

		history++;
		
		if(token.getName().equals(WordType.PERIOD.getName())){
			rewind();
		}
		
		
		return "first="+feature;
	}
	
	public void rewind(){
		history=0;
	}
}

